import pandas as pd
import numpy as np

my_list=['算法','软件','前端','人工智能','Android','Java','安卓','运维','图像','数据']
my_list1=['成都','西安','北京','杭州','上海','南京','武汉','深圳','广州']
for l in my_list:
    for i in my_list1:
        # print("正在分离含有\"{}\"的".format(l) +format(i) +"数据")
        input_file = f"./data4_3_classify_job/{l}.xlsx"
        output_file = f"./data4_4_classify_job/{l}{i}.xlsx"
        # output_file="./data4_1_classify_name/{}".format(l)+format(i) +"xlsx"
        data1 = pd.read_excel(input_file)

        data1 = data1.drop("Unnamed: 0",axis=1)
        data1 = data1.values
        job_name = []
        company_name = []
        salary = []
        address = []
        education_requirements = []
        for item in data1:
            print(item)
            if i in item[3]:
                    job_name.append(item[0])
                    company_name.append(item[1])
                    salary.append(item[2])
                    address.append(item[3])
                    education_requirements.append(item[4])
        data2 = {"job_name": job_name,
                 "company_name": company_name,
                 "salary": salary,
                 "address": address,
                 "education_requirements": education_requirements}
        data2 = pd.DataFrame(data2)
        data2.to_excel(output_file)
